<template>
  <div class="per-home">
    <el-divider><span class="expl-writing">个人信息</span></el-divider>
    <ul class="person-message">
      <li><span>昵称:</span>{{userinfo.nickname}}</li>
      <li><span>账号:</span>{{userinfo.account}}</li>
      <li><span>性别:</span>{{sexDeal(userinfo.sex)}}</li>
      <div class="sign">
        <span>签名:</span>
        <p>{{userinfo.sign}}</p>
      </div>
    </ul>
  </div>
</template>

<script>
import { getUserInfo } from '@/api/login'
export default {
  data() {
    return {
      userinfo: {}
    }
  },
  computed: {},
  methods: {
    sexDeal(sex) {
      if (sex == 0) {
        return '女'
      } else if (sex == 1) {
        return '男'
      } else {
        return '未知'
      }
    },
    async getinfo() {
      let res = await getUserInfo()
      console.log(res.data.data)
      this.userinfo=res.data.data
    }
  },
  created() {
    this.getinfo()
  }
}
</script>

<style lang="less" scoped>
.per-home {
  min-height: 400px;
  padding: 30px 30px 0 30px;
  .expl-writing {
    font-size: 16px;
    letter-spacing: 3px;
    color: rgba(0, 0, 0, 0.6);
  }
  .person-message {
    li {
      height: 50px;
      font-size: 15px;
      letter-spacing: 1px;
      span {
        display: inline-block;
        margin-right: 20px;
        width: 80px;
        text-align: right;
        letter-spacing: 2px;
        color: rgba(0, 0, 0, 0.6);
      }
    }
    /* 签名 */
    .sign {
      display: flex;
      min-height: 60px;
      font-size: 15px;
      span {
        margin-right: 20px;
        width: 80px;
        text-align: right;
        letter-spacing: 2px;
        color: rgba(0, 0, 0, 0.6);
      }
      p {
        flex: 1;
        line-height: 22px;
        font-family: '宋体';
        letter-spacing: 1px;
      }
    }
  }
}
</style>